# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=networkmanager-vpnc
pkgver=1.2.6
pkgrel=1
pkgdesc="NetworkManager VPN plugin for VPNC"
url="https://wiki.gnome.org/Projects/NetworkManager"
arch=(x86_64)
license=(GPL)
depends=(libnm libsecret vpnc)
makedepends=(libnm-gtk intltool python git)
_commit=c6192e3bec500107357884657b6d085295d672cb  # tags/1.2.6^0
source=("git+https://gitlab.gnome.org/GNOME/network-manager-vpnc.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd network-manager-vpnc
  git describe --tags | sed 's/-dev/dev/;s/-/+/g'
}

prepare() {
  cd network-manager-vpnc
  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd network-manager-vpnc
  ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
    --libexecdir=/usr/lib --disable-static
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package() {
  cd network-manager-vpnc
  make DESTDIR="$pkgdir" install
}
